<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div>Price: {{price}}</div>
        <div>Total: {{price * quantity}}</div>
        <div>getTotal: {{getTotal}}</div>
    </div>
</body>
<!-- 
    effect 副作用函数
    track 收集依赖(收集副作用函数)
    trigger 触发依赖(触发副作用函数)
    targetmap depsmap dep

    get时收集依赖
    set时触发依赖

    activeEffect 当前运行的effect函数
    let activeEffect = null;
    const effect = eff => {
        activeEffect = eff; // 1. 将 eff 函数赋值给 activeEffect
        activeEffect();     // 2. 执行 activeEffect 收集依赖
        activeEffect = null;// 3. 重置 activeEffect
    }

    收集依赖的入口:
    执行副作用函数,开始收集
    effect()
 -->
<script>


</script>
</html>